<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="949.43">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Helvetica; color: #0000f0}
p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Helvetica}
p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Helvetica; min-height: 17.0px}
p.p6 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Helvetica; min-height: 16.0px}
p.p7 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #c20000}
p.p8 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco}
p.p9 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; min-height: 12.0px}
p.p10 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #007400}
span.s1 {font: 18.0px Helvetica}
span.s2 {color: #000000}
span.s3 {color: #0000c0}
span.Apple-tab-span {white-space:pre}
</style>
</head>
<body>
<p class="p1"><span class="s1"><b>LPCAna<span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></b></span><b>creates LPC analysis file (adapted and expanded from R. Moore's LPC<span class="Apple-converted-space"> </span></b></p>
<p class="p1"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>analysis code from 'Computer Music' ...</b></p>
<p class="p2"><br></p>
<p class="p3"><span class="s2"><b>See also: </b><a href="LPCFile.html"><b>LPCFile</b></a><b>, </b><a href="LPCSynth.html"><b>LPCSynth</b></a><b>, </b><a href="LPCVals.html"><b>LPCVals</b></a></span></p>
<p class="p2"><br></p>
<p class="p4"><b>Class Methods</b></p>
<p class="p5"><b><span class="Apple-tab-span">	</span></b></p>
<p class="p1"><b><span class="Apple-tab-span">	</span>*new(path)</b></p>
<p class="p1"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>path - the path for a mono sound file to analyze</b></p>
<p class="p6"><br></p>
<p class="p4"><b>Instance Methods</b></p>
<p class="p5"><br></p>
<p class="p1"><b><span class="Apple-tab-span">	</span>ana(nPoles, frameSize, hop, channel, minFreq, maxFreq, check, conditionSignal, completion)</b></p>
<p class="p1"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>nPoles - </b>the number of poles for the all-pole filter (default: 35, must be less the 200)</p>
<p class="p1"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>frameSize - </b>the number of samples to use for each from of analysis (default: 400)</p>
<p class="p1"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>hop - </b>a percentage of the frameSize to skip for the next window (default: 0.5)</p>
<p class="p1"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>channel - </b>the channel to analyze if the file at 'path' is multi-channel (default: 0)</p>
<p class="p1"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>minFreq - </b>a minFreq to search for in pitch tracking (defautl: 70)</p>
<p class="p1"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>maxFreq - </b>a maxFreq to search for in pitch tracking (default: 200)</p>
<p class="p1"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>check - </b>attempts to check poles for stability. <b>WARNING: </b>Somewhere in this code, I've made<span class="Apple-converted-space"> </span></p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>a terrible mistake. It actually CAUSES instabilities rather then getting rid of them... but</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>I can't, for the life of me, see where the error is. Don't use it. Moore's basic algorithm is<span class="Apple-converted-space"> </span></p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>pretty good, and the filters seems fairly stable. If you have problems, try increasing the<span class="Apple-converted-space"> </span></p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>number of poles (default: 0)</p>
<p class="p1"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>conditionSignal - </b>if 0, does nothing, if 1, applies a simple low pass filter to each window</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>before doing the analysis (which helps avoid instabilities), or 2, apply a DRASTIC low pass</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>filter to the signal that I saw in some of CSounds LPC code. This REALLY smoothes out</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>the signal, and usually causes some pretty crazy instabilities because the output of the</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>filter is SO resonant. (default: 0, 1 works well, choose 2 if you want exploding filters that</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>might (?) be interesting.</p>
<p class="p1"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>completion -</b> a function to evaluate when the analysis is finished. Handy for bulk analyzing files,<span class="Apple-converted-space"> </span></p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>and auto saving them.</p>
<p class="p5"><br></p>
<p class="p1"><b><span class="Apple-tab-span">	</span>lperr(numTurns) - </b>low pass the error signal numTurns times</p>
<p class="p1"><b><span class="Apple-tab-span">	</span>lprms(numTurns) - </b>low pass the overall rms signal numTurns times</p>
<p class="p1"><b><span class="Apple-tab-span">	</span>lppch(numTurns) - </b>low pass the pchcps signal numTurns times</p>
<p class="p2"><span class="Apple-tab-span">	</span></p>
<p class="p1"><b><span class="Apple-tab-span">	</span>saveToLPCFile(path) - </b>save file to an LPC file usable by LPCFile, LPCSynth and LPCVals.</p>
<p class="p1"><b><span class="Apple-tab-span">	</span>saveToFiles(path) - </b>save file to an LPC file usable by LPCFile, LPCSynth and LPCVals, as well as a<span class="Apple-converted-space"> </span></p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>floating point .aif data file for use in NRT.</p>
<p class="p2"><span class="Apple-tab-span">	</span></p>
<p class="p1"><b>Usage:</b></p>
<p class="p2"><br></p>
<p class="p7"><span class="s2"><span class="Apple-tab-span">	</span>a = </span><span class="s3">LPCAna</span><span class="s2">.new(</span>"sounds/a11wlk01.wav"<span class="s2">);</span></p>
<p class="p8"><span class="Apple-tab-span">	</span>a.ana(<span class="s3">50</span>, <span class="s3">400</span>, <span class="s3">0.5</span>, <span class="s3">0</span>, <span class="s3">70</span>, <span class="s3">300</span>);</p>
<p class="p9"><span class="Apple-tab-span">	</span></p>
<p class="p10"><span class="s2"><span class="Apple-tab-span">	</span></span>// low pass an aspect of the analysis</p>
<p class="p8"><span class="Apple-tab-span">	</span>a.err.plot</p>
<p class="p8"><span class="Apple-tab-span">	</span>a.lperr;</p>
<p class="p8"><span class="Apple-tab-span">	</span>a.err.plot;</p>
<p class="p9"><span class="Apple-tab-span">	</span></p>
<p class="p8"><span class="Apple-tab-span">	</span>a.pchcps.plot;</p>
<p class="p8"><span class="Apple-tab-span">	</span>a.lppch;</p>
<p class="p8"><span class="Apple-tab-span">	</span>a.pchcps.plot;</p>
</body>
</html>
